package com.frank.oj.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.frank.model.entity.contest.ContestRecord;
import com.frank.oj.model.vo.ContestRecordVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author frank
 * @Date 2024/4/7
 */
@Mapper
public interface ContestRecordMapper extends BaseMapper<ContestRecord> {

    List<ContestRecordVO>  getACMContestRecord(@Param("contestCreatorUid") String contestCreatorUid,
                                               @Param("cid") Long cid,
                                               @Param("externalCidList") List<Integer> externalCidList,
                                               @Param("time") Long time);

    List<ContestRecordVO> getOIContestRecordByRecentSubmission(@Param("cid") Long cid,
                                                               @Param("externalCidList") List<Integer> externalCidList,
                                                               @Param("contestCreatorUid") String contestCreatorUid,
                                                               @Param("isOpenSealRank") Boolean isOpenSealRank,
                                                               @Param("sealTime") Long sealTime,
                                                               @Param("endTime") Long endTime,
                                                               @Param("isContainsAfterContestJudge") Boolean isContainsAfterContestJudge);

    List<ContestRecordVO> getOIContestRecordByHighestSubmission(@Param("cid") Long cid,
                                                                @Param("externalCidList") List<Integer> externalCidList,
                                                                @Param("contestCreatorUid") String contestCreatorUid,
                                                                @Param("isOpenSealRank") Boolean isOpenSealRank,
                                                                @Param("sealTime") Long sealTime,
                                                                @Param("endTime") Long endTime,
                                                                @Param("isContainsAfterContestJudge") Boolean isContainsAfterContestJudge);

    List<ContestRecord> getACInfo(@Param("status") Integer status, @Param("cid") Long cid);
}
